import React, { Component } from 'react'
import PubSub from 'pubsub-js'
export default class Son extends Component {
  render() {
    PubSub.subscribe('yyy', (topic, data) => {
      console.log('son', topic, data)
    })
    return (
      <div>
        Son
        <br />
        <button
          onClick={() => {
            PubSub.publish('xxx', 999)
          }}
        >
          发布xxx话题的数据
        </button>
      </div>
    )
  }
}
